Ext.define('Safe.view.user.UserGrid',{
    extend:'Ext.grid.Panel',
    //requires:['Safe.store.user.UserStore'],
    alias:'widget.UserGrid',
    initComponent:function(){
        var me=this;
        this.store={
            fields:['id','name','password','birthday','createTime'],
            data:[
            {
                "id": "1",
                "name": "卜浩",
                "password":"1991",
                "birthday": "1991-10-26",
                "createTime": "1991-10-26"
            }
            ],
            autoLoad:true
        },
        Ext.applyIf(me,{
//            store:'userStore',
            columns:[
            {
                xtype: 'gridcolumn',
                dataIndex: 'id',
                text: '编号'
            },
            {
                xtype: 'gridcolumn',
                dataIndex: 'name',
                text: '姓名'
            },
            {
                xtype: 'gridcolumn',
                dataIndex: 'password',
                text: '密码'
            },
            {
                xtype: 'gridcolumn',
                dataIndex: 'birthday',
                text: '出生日期'
            },
            {
                xtype: 'gridcolumn',
                dataIndex: 'createTime',
                text: '创建日期'
            }
            ],
            dockedItems: [
            {
                xtype: 'toolbar',
                dock: 'top',
                items: [
                {
                    xtype: 'button',
                    text: '查看',
                    listeners: {
                        click: {
                            fn: me.onButtonClick,
                            scope: me
                        }
                    }
                },
                {
                    xtype: 'button',
                    text: '添加',
                    listeners: {
                        click: {
                            fn: me.onButtonClick1,
                            scope: me
                        }
                    }
                },
                {
                    xtype: 'button',
                    text: '编辑'
                },
                {
                    xtype: 'button',
                    text: '其他',
                    menu: {
                        xtype: 'menu',
                        width: 120,
                        items: [
                        {
                            xtype: 'menuitem',
                            text: 'Menu Item'
                        },
                        {
                            xtype: 'menuitem',
                            text: 'Menu Item'
                        },
                        {
                            xtype: 'menuitem',
                            text: 'Menu Item'
                        }
                        ]
                    }
                }
                ]
            }
            ]
        });
        me.callParent(arguments);
    }
});


